package zjl.base;

import zjl.graph.Vertex;

import java.util.HashSet;
import java.util.Set;

public class NodeBase extends Vertex {

    public static final int UNKNOWN = -1;
    public static final int HOSTNODE = 0;
    public static final int SWITCHNODE = 1;

    private int type = UNKNOWN;
    private String name;
    private Set<String> ports;
    private int portNum;

    public NodeBase(String name, int type, int portNum) {
        super();
        this.name = name;
        this.type = type;
        this.portNum = portNum;

        this.ports = new HashSet<>();
        for (int i = 0; i < portNum; i++)
            this.ports.add(this.name + "-p" + i);
    }

    public int getType() {
        return this.type;
    }

    public String getName() {
        return this.name;
    }
}
